package com.gitee.wsl.unit.angle.ext

import com.gitee.wsl.unit.angle.AngleUnit
import kotlin.jvm.JvmStatic

/**
 * Indicates whether a specified value is within the normal range of latitude, [-90, 90].
 * @param degrees The value to test, in degrees.
 * @returns true if the value is within the normal range of latitude, otherwise false.
 */

fun AngleUnit.Companion.isValidLatitude(degrees: Double) = degrees >= -90 && degrees <= 90

/**
 * Indicates whether a specified value is within the normal range of longitude, [-180, 180].
 * @param degrees The value to test, in degrees.
 * @returns true if the value is within the normal range of longitude, otherwise false.
 */

fun AngleUnit.Companion.isValidLongitude(degrees: Double) = degrees >= -180 && degrees <= 180